home *** CD-ROM | disk | FTP | other *** search
- Path: Belgium.EU.net!news
- From: albert@sonytel.be (Albert Dorofiev)
- Newsgroups: comp.lang.c++
- Subject: Re: Need help!
- Date: 14 Mar 1996 09:13:17 GMT
- Organization: EUnet Belgium, Leuven, Belgium
- Message-ID: <4i8nvd$e0k@news.Belgium.EU.net>
- References: <Do858A.Btr@iquest.net>
- NNTP-Posting-Host: iris.sonytel.be
- X-Newsreader: knews 0.9.5
-
- In article <Do858A.Btr@iquest.net>,
- tjones@walknet.com writes:
- :> Can data structures be passed to classes? In this overly simple
- :> program below, I can fill a data structure in the desc function
- :> of the reg class, but I can not decrement
- :> to the beginning of the structure, so that I can print it out
- :> within the class function.
- :>
- :> /* Here is the problem area*/
- :>
- :> for(y=0;y<25;y++) dptr--;
- :>
- :> for(y=0;y<25;y++)
- :> printf("\n%4d %s",y,dptr->name);
- :>
-
- You do decrement it, but you do not increment it while
- printing the results out.
- printf("\n%4d %s",y,(dptr++)->name);
- --
- Albert Dorofeev albert@sonytel.be
-
-
-